<template>
    <div class="operatorBusinessProcess">
        <h4 class="title">基础信息</h4>
        <el-form :model="businessProcessForm" label-width="120px">
            <el-form-item label="选择城市">
                <el-select v-model="businessProcessForm.region" placeholder="选择城市">
                    <el-option label="北京" value="beijing"></el-option>
                    <el-option label="上海" value="shanghai"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="业务类型">
                <el-select v-model="businessProcessForm.businessType" placeholder="请选择业务类型">
                    <el-option label="新房产权" value="xinfang"></el-option>
                    <el-option label="二手房产权" value="ershoufang"></el-option>
                    <el-option label="商业产权" value="shangye"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="业务流程名称">
                <el-input style="width: 350px;" v-model="businessProcessForm.businessName" placeholder="请输入业务名称"></el-input>
            </el-form-item>
        </el-form>
        <h4 class="title">业务流程</h4>
        <div class="custom-tree-node">
            <span class="all">全选</span>
            <span>节点编码</span>
            <span>节点名称</span>
            <span>是否回款</span>
            <span>是否结佣</span>
            <span>前置完成</span>
            <span>操作</span>
        </div>
        <el-tree
                :data="treeData"
                show-checkbox
                node-key="id"
                default-expand-all
                :expand-on-click-node="false">
            <div class="custom-tree-node" slot-scope="{ node, data }">
                <span :class="'level' + node.level">{{ node.label }}</span>
                <span>节点名称</span>
                <span>是否回款</span>
                <span>是否结佣</span>
                <span>前置完成</span>
                <span>操作</span>
            </div>
        </el-tree>
    </div>
</template>

<script type="text/ecmascript-6">
    export default {
        name: 'operatorBusinessProcess',
        data() {
            return {
                businessProcessForm: {},
                form: {},
                treeData: [{
                    id: 1,
                    label: '一级 1',
                    children: [{
                        id: 4,
                        label: '二级 1-1',
                        children: [{
                            id: 9,
                            label: '三级 1-1-1'
                        }, {
                            id: 10,
                            label: '三级 1-1-2'
                        }]
                    }]
                }, {
                    id: 2,
                    label: '一级 2',
                    children: [{
                        id: 5,
                        label: '二级 2-1'
                    }, {
                        id: 6,
                        label: '二级 2-2'
                    }]
                }, {
                    id: 3,
                    label: '一级 3',
                    children: [{
                        id: 7,
                        label: '二级 3-1'
                    }, {
                        id: 8,
                        label: '二级 3-2'
                    }]
                }]
            }
        },
        created() {
            
        },
        mounted() {
            
        },
        methods: {
            sss(node, data) {
                console.log(node, data);
            }
        },
        components: {},
        computed: {}
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="stylus">
    .operatorBusinessProcess {
        .title {
            border-bottom: 1px solid #ccc;
            padding-bottom 10px;
        }
    }

    .custom-tree-node {
        width: 100%;
        display: flex;
        justify-content: space-between;
        .all {
            flex: none;
            display: inline-block;
            width: 80px;
            text-align: center;
        }
        span {
            flex: 1;
        }
        .level1 {
            padding-left: 36px;
        }
        .level2 {
            padding-left: 18px;
        }
    }
</style>
